package com.think.archive.controller.api;

import com.think.archive.common.ResultBean;
import com.think.archive.model.*;
import com.think.archive.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("api")
public class DeptController {

    @Autowired
    SysDeptService deptService;

    @GetMapping("depts")
    public ResultBean getDepts(@RequestParam(value = "deptCode", required = false) String deptCode){
        List<SysDept> depts=deptService.findNextLevelDept(deptCode);
        return ResultBean.createResultBySuccess(depts);
    }

}
